/*
 * @Author: xiezh 602666178@qq.com
 * @Date: 2022-12-13 08:48:21
 * @LastEditors: xiezh
 * @LastEditTime: 2022-12-13 09:26:16
 * @Description: file content
 */

const router = require('koa-router')()
const { respondOk } = require('../utils/responseTemplate')

/**
 * get
 */
router.get('/home', async function (ctx, next) {
    const query = ctx.request.query
    console.log('参数：', query);
    const result = [
        {
            name: "xiezh"
        }
    ]
    ctx.body = respondOk(result)
})


/**
 * delete
 */
router.delete('/projects', async function (ctx, next) {
    const query = ctx.request.query
    console.log('参数：', query);
    ctx.body = respondOk()
})

/**
 * put
 */
router.put('/projects/status', async function (ctx, next) {
    const body = ctx.request.body
    console.log('参数：', body);
    ctx.body = respondOk()
})

/**
 * post
 */
router.post('/projects/create', async function (ctx, next) {
    const body = ctx.request.body
    console.log('参数：', body);
    ctx.body = respondOk()
})

module.exports = router
